﻿using Common.MQ;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Common.Kafka
{
    /// <summary>
    /// 
    /// </summary>
    public static class DependencyInjectionExtension
    {
        /// <summary>
        /// 添加kafka支持
        /// </summary>
        /// <param name="services"></param>
        /// <param name="setting"></param>
        /// <returns></returns>
        public static KafkaBuilder AddKafka(this IServiceCollection services, KafkaSetting setting)
        {
            services.AddSingleton(setting);
            var builder = new KafkaBuilder(setting, services);
            return builder;
        }
    }
}
